﻿using furion.blog.Domain.Shared.ValidateAttribute;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace furion.blog.Domain.Shared.Dto.User
{
    public class UserUpdateDto
    {

        [JsonProperty(PropertyName = "userId")]
        public long? UserId { get; set; } = null;

        [JsonProperty(PropertyName = "userName")]
        [Required(ErrorMessage = "请填写账号")]
        public string UserName { get; set; } = string.Empty;

        [JsonProperty(PropertyName = "realName")]
        [Required(ErrorMessage = "请填写姓名")]
        public string RealName { get; set; } = string.Empty;

        [JsonProperty(PropertyName = "nickName")]
        public string NickName { get; set; } = string.Empty;

        [JsonProperty(PropertyName = "roleId")]
        [Required(ErrorMessage = "请选择角色")]
        public long? RoleId { get; set; } = null;

        [JsonProperty(PropertyName = "deptId")]
        [Required(ErrorMessage = "请选择部门")]
        public long? DeptId { get; set; } = null;

        [JsonProperty(PropertyName = "phone")]
        [PhoneValidateAttribute(ErrorMessage = "电话格式有误")]
        public string Phone { get; set; } = string.Empty;

        [JsonProperty(PropertyName = "sex")]
        [Required(ErrorMessage = "请选择性别")]
        public string Sex { get; set; } = string.Empty;

        [JsonProperty(PropertyName = "remark")]
        public string Remark { get; set; } = string.Empty;

        [JsonProperty(PropertyName = "email")]
        public string Email { get; set; } = string.Empty;

        [JsonProperty(PropertyName = "avatar")]
        public string Avatar { get; set; } = string.Empty;

        public long? UpdatedBy { get; set; } = null;
        public DateTime? UpdatedTime { get; set; } = DateTime.Now;

    }
}
